package _06_动态规划;

public class _55_跳跃游戏 {

    public boolean canJump(int[] nums) {
        int end = nums.length - 1;
        int maxInstance = nums[0];
        if (maxInstance >= end) return true;
        for (int i = 1; i < nums.length; i++) {
            if (i > maxInstance) {
                return false;
            }
            if (nums[i] + i > maxInstance) {
                maxInstance = nums[i] + i;
                if (maxInstance >= end) return true;
            }
        }
        return false;
    }

}
